/*
function killErrors() {
    return true;
}
window.onerror = killErrors;
*/

var hostnamess = document.domain;
function getcookiess(name) {
	var cookie_start = document.cookie.indexOf(name);
	var cookie_end = document.cookie.indexOf(";", cookie_start);
	return cookie_start == -1 ? '' : unescape(document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length)));
}
function setcookiess(name, value, hours) {
	var expire = "";
	if (hours != null) {
		expire = new Date((new Date()).getTime() + hours * 3600000);
		expire = "; expires=" + expire.toGMTString();
	}
	document.cookie = name + "=" + encodeURIComponent(value) + "; domain=" + hostnamess + ";path=/" + expire;
}
function closeFloat(){
	leftCouple.style.visibility='hidden';
	rightCouple.style.visibility='hidden';
	setcookiess("csfloat", "1", 24);
	/*
	leftFloat.style.visibility='hidden';
	rightFloat.style.visibility='hidden';
	*/
}
var domain="";
var adtoptxt="";
var indextop="";
var list="";
var play="";
var foot="";
var mail="";
var sihu="";
var footlink="";
var listad="";
var txtcommend="";
var txtgg="";
var vodhelp="";
var vodhelp1="";
var palyhelp="";
var adLeftCouple="";
var adRightCouple="";
var adLeftFloat="";
var adRightFloat="";
var adLeftCoupleTop=0;
var adLeftCoupleLeft=0;
var adLeftCoupleTxt="";
var adRightCoupleTop=0;
var adRightCoupleRight=0;
var adRightCoupleTxt="";
var adLeftFloatLeft=0;
var adLeftFloatBottom=0;
var adLeftFloatTxt="";
var adRightFloatRight=0;
var adRightFloatBottom=0;
var adRightFloatTxt="";
var pfwidth="";
var pfheight="";
var adplayer="";
var tongji="";
var cssurl="";
var adhost=window.location.host.toLowerCase();
var btnClose = "";
var picTopAds = "";
var picFootAds = "";
var dyplayTxt = "";

var myDate = new Date();
var date1 = (myDate.getMonth()+1);
date1="0"+date1;
var day1 = myDate.getDate();
day1="0"+day1;
//取后2位
date1=date1.substring(date1.length-2,date1.length);
day1=day1.substring(day1.length-2,day1.length);
//关闭按钮，暂时未用
btnClose = '<div style="position:absolute;top:0px;right:0px;margin:1px;width:15px;height:15px;line-height:16px;background:#000;font-size:11px;text-align:center;"><a href="javascript:closeFloat();" style="color:white;text-decoration:none;">×</a></div>';
function scrollx(p) {
    var d = document,
    dd = d.documentElement,
    db = d.body,
    w = window,
    o = d.getElementById(p.id),
    ie6 = /msie 6/i.test(navigator.userAgent),
    style,
    timer;
    if (o) {
        o.style.cssText += ";z-index:999;position:" + (p.ofloat && !ie6 ? 'fixed': 'absolute') + ";" + (p.oleft == undefined ? '': 'left:' + p.oleft + 'px;') + (p.otop == undefined ? '': 'top:' + p.otop + 'px') + (p.oright == undefined ? '': 'right:' + p.oright + 'px;') + (p.obottom == undefined ? '': 'bottom:' + p.obottom + 'px');
        if (p.ofloat && ie6) {
            if (p.otop != undefined) {
                o.style.cssText += ';top:expression(documentElement.scrollTop + ' + p.otop + ' + "px" );';
            }
            if (p.oleft != undefined) {
                o.style.cssText += ';left:expression(documentElement.scrollLeft + ' + p.oleft + ' + "px");';
            }
            if (p.obottom != undefined) {
                o.style.cssText += ';top:expression(documentElement.clientHeight - ' + o.offsetHeight + ' + documentElement.scrollTop - ' + p.obottom + ' + "px" );';
            }
            if (p.oright != undefined) {
                o.style.cssText += ';left:expression(documentElement.clientWidth - ' + o.offsetWidth + ' + documentElement.scrollLeft - ' + p.oright + ' + "px" );';
            }
            dd.style.cssText += ';background-image: url(about:blank);background-attachment:fixed;';
        } else {
            if (!p.ofloat) {
                w.onresize = w.onscroll = function() {
                    clearInterval(timer);
                    timer = setInterval(function() {
                        var st = (dd.scrollTop || db.scrollTop),
                        c;
                        c = st - o.offsetTop + (p.otop != undefined ? p.otop: (w.innerHeight || dd.clientHeight) - o.offsetHeight);
                        if (c != 0) {
                            o.style.top = o.offsetTop + Math.ceil(Math.abs(c) / 10) * (c < 0 ? -1 : 1) + 'px';
                        } else {
                            clearInterval(timer);
                        }
                    },
                    10)
                }
            }
        }
    }
}
//domain
	domain=domain+"<script src=\"/js/index/domain.js\"></script>"; 

//广告顶部文字
//adtoptxt=""

//全站顶部通栏
	indextop=indextop+"<script src=\"/js/index/index.js\"></script>"; 
	//adtop=adtop+"<li><a href=\"https://18jsbet.com/main.html\" target=\"_blank\"><img border=\"0\" src=\"https://ading.222im.com/2018/jsjs1.gif\"><\/a></li>"; 
//list栏目
	list=list+"<script src=\"/js/index/list.js\"></script>"; 
//播放页横幅
	play=play+"<script src=\"/js/index/play.js\"></script>"; 
//全站底部
	foot=foot+"<script src=\"/js/index/footer.js\"></script>";
	

//底部信息
//        footlink=footlink+"<div style='width:960px;margin:0 auto;height:50px;line-height:50px;clear:both;font-size:14px;'>站点申明：我们立足于美利坚合众国，受北美法律保护,未满18岁或被误导来到这里，请立即离开！| 广告联系: @ </div>";

//对联和漂浮
if(!navigator.userAgent.match(/Android/i) && !navigator.userAgent.match(/iphone|mac/i)){
	pfwidth="150";
	pfheight="350";
}else{
	pfwidth="60";
	pfheight="140";
}
	adLeftCoupleTxt='<a href="/js/url.html?url=https://www.20yyhh.com" target="_blank"><img src="https://ading.222im.com/2018/Galaxy150.gif" width="'+pfwidth+'" height="'+pfheight+'"></a>';
	adRightCoupleTxt='<a href="/js/url.html?url=https://www.20yyhh.com" target="_blank"><img src="https://ading.222im.com/2018/Galaxy150.gif" width="'+pfwidth+'" height="'+pfheight+'"></a>';

//	adLeftFloatLeft=0;
//	adLeftFloatBottom=0;
//	adLeftFloatTxt='<a href="https://www.102hgvip.com/main.html" target="_blank"><img src="https://xxx.11img.com/ad/2002001.gif" border="0" width="200" height="200"></a>';

//	adRightFloatRight=0;
//	adRightFloatBottom=0;
//	 adRightFloatTxt='<a href="https://www.102hgvip.com/main.html" target="_blank"><img src="https://xxx.11img.com/ad/2002002.gif" border="0" width="200" height="200"></a>';



//以下代码请勿修改
//if(!navigator.userAgent.match(/Android/i) && !navigator.userAgent.match(/iphone|mac/i)){

	var csfloat=getcookiess("csfloat");
	if (typeof(csfloat) == "undefined" || csfloat==""){
		if (adLeftCoupleTxt != "") {
		    adLeftCoupleTop="100";
		    adLeftCouple += '<div id="leftCouple" style="position:absolute;top:' + adLeftCoupleTop + 'px;left:' + adLeftCoupleLeft + 'px;">' + adLeftCoupleTxt + '<div style="position:absolute;top:0px;right:0px;margin:1px;width:20px;height:20px;line-height:16px;background:#000;font-size:11px;text-align:center;"><a href="javascript:closeFloat();" style="color:white;font-size:20px;text-decoration:none;">×</a></div></div>';// onclick="leftCouple.style.visibility=\'hidden\';"
		    document.writeln(adLeftCouple);
		    scrollx({
		        id: 'leftCouple',
		        otop: adLeftCoupleTop,
		        oleft: adLeftCoupleLeft,
		        ofloat: 1
		    })
		}
		if (adRightCoupleTxt != "") {
		    adRightCoupleTop="100";
		    if(!navigator.userAgent.match(/Android/i) && !navigator.userAgent.match(/iphone|mac/i)){
		    	adRightCoupleRight="20";
		    }
		    adRightCouple += '<div id="rightCouple" style="position:absolute;top:' + adRightCoupleTop + 'px;right:' + adRightCoupleRight + 'px;">' + adRightCoupleTxt + '<div style="position:absolute;top:0px;right:0px;margin:1px;width:20px;height:20px;line-height:16px;background:#000;font-size:11px;text-align:center;"><a href="javascript:closeFloat();" style="color:white;font-size:20px;text-decoration:none;">×</a></div></div>';// onclick="rightCouple.style.visibility=\'hidden\';"
		    document.writeln(adRightCouple);
		    scrollx({
		        id: 'rightCouple',
		        otop: adRightCoupleTop,
		        oright: adRightCoupleRight,
		        ofloat: 1
		    })
		}
		if (adLeftFloatTxt != "") {
		    adLeftFloat += '<div id="leftFloat" style="position:absolute;bottom:' + adLeftFloatBottom + 'px;left:' + adLeftFloatLeft + 'px;">' + adLeftFloatTxt + '</div>';
		    document.writeln(adLeftFloat);
		    scrollx({
		        id: 'leftFloat',
		        oleft: adLeftFloatLeft,
		        obottom: adLeftFloatBottom,
		        ofloat: 1
		    })
		}
		if (adRightFloatTxt != "") {
		    adRightFloat += '<div id="rightFloat" style="position:absolute;bottom:' + adRightFloatBottom + 'px;right:' + adRightFloatRight + 'px;">' + adRightFloatTxt + '</div>';
		    document.writeln(adRightFloat);
		    scrollx({
		        id: 'rightFloat',
		        oright: adRightFloatRight,
		        obottom: adRightFloatBottom,
		        ofloat: 1
		    })
		}
	}
//}




//电影介绍页红色字
	sihu=sihu+'<div class="vticker"><li><b>[四虎公告] : </b> 四虎 [4hu.com] 12.20 近日本站遭受攻击！若访问失败(播放失败)请稍后片刻访问！给您带来不便请谅解！</li></div>';
	//所有出现
	txtgg=txtgg+'<a href="/help/vod.html"><font color="#FF0000">该视频侵权删除，播放报错点击这里！</font></a>';
	txtcommend=txtcommend+'<strong><a href="/help/gg.html"><font color="#FF0000">本站最新公告！用户必看</font></a></strong>';
	//mail
	//mail=mail+'@gmail.com';

	//內容頁播放文字
	vodhelp=vodhelp+'<a href="/help/m-play.html" target="_blank"><span style="color:#ff0000;line-height:1.5;font-size:16px;">【手机播放教程】</span></a><a href="/help/pc-play.html" target="_blank"><span style="color:#ff0000;line-height:1.5;font-size:16px;">【电脑播放教程】</span></a> </span>';
	vodhelp1=vodhelp1+'<span style="color:#0086cf;line-height:1.5;font-size:16px;">【提示：在线播放为标清版，若对画质有要求的朋友，请选择下载高清版到本地播放】</span>';
	//播放頁文字
	palyhelp=palyhelp+'<span class="playerTip"><a href="/help/index.htm" target="_blank" class="white">提示：若遇无法播放，视频加载失败问题！请点击查看帮助教程！</a></span>';
//aaa
	if(navigator.userAgent.match(/Android/i)) {
		txtcommend=txtcommend+'<font color="#FF0000"><strong>.</strong></font>';
	}

//图片

	//aaa
	if(navigator.userAgent.match(/Android/i)) {
		//picTopAds = picTopAds + '<div class="picTop"><a href="http://apk.ycszf.com/p3/apkindex.html" target="_blank"><img src="http://ww2.sinaimg.cn/large/005StFp9jw1er6gf6xajvg30ri01yabd.gif" width="100%" height="60" /></a></div>';
	}

	//所有出现
	//picTopAds = picTopAds + '<div class="picTop2"><a href="http://www.050gg.com/main.html?m=free2&Intr=332" target="_blank"><img src="http://cache.adm-cnzz.net/material/36/d/xed500700.gif" width="500" height="700" /></a></div>';

//图片小说 内容区底部
//	picFootAds = picFootAds + '<div class="picTop"><a href="http://jump.chaoji28.net" target="_blank"><img src="http://43.249.28.104:88/1.gif" width="100%" height="60" /></a></div>';



	//aas
//	if(navigator.userAgent.match(/Android/i)) {
//		dyplayTxt = "<a href='http://apk.ycszf.com/p3/1index.html' target='_blank'> <font color=red>如果在线播放卡请下载官方高清播放器海量大片，点击精彩继续。<font></a>";
//	}







function errimg(obj,image) {
	obj.src = image;
	obj.onerror = null;
}


var hostname;
var hostname2;
var hostnametxt;
var hostnamelogo;
var lf=window.location.host.toLowerCase().split(".");
hostname2=sbc2dbc(window.location.host.toUpperCase());
if (lf.length>1){
	hostname=lf[lf.length-2] + "." + lf[lf.length-1]
	//hostnametxt="www." + hostname.substring(0,3) + hostname.substring(3,hostname.length);
	hostnametxt=lf[lf.length-2];
	hostnamelogo=hostnametxt+"<span style='font-size:24px;color:#881313'>."+lf[lf.length-1]+"</font>";
	document.title=document.title+hostname2;
	if (document.getElementById("WebUrl")){
		document.getElementById("WebUrl").innerHTML=hostname2;
	}
}
window.status=hostname2;

function StayPosition(speed) {
    this.objs = [];
    this.speed = speed || 0.1;
    this.timer = this.round = this.obj = this.end = null;
    if (StayPosition.initialize !== true) {
        function correct(func, obj) {
            return function() {
                func.call(obj);
            }
        }
        StayPosition.prototype.start = function() {
            this.timer = setInterval(correct(this.run, this), 33);
        }
        StayPosition.prototype.stop = function() {
            clearInterval(this.timer);
        }
        StayPosition.prototype.capitalize = function(prop) {
            return prop.replace(/^[a-z]/,
            function(a) {
                return a.toUpperCase();
            })
        }
        StayPosition.prototype.add = function(dom, prop) {
            var offset = prop ? "offset" + this.capitalize(prop) : "offsetTop";
            var scroll = prop ? "scroll" + this.capitalize(prop) : "scrollTop";
            prop = prop ? prop: this.offset.slice(6).toLowerCase();
            this.objs.push({
                "dom": dom,
                "prop": {
                    "size": dom[offset],
                    "name": prop,
                    "offset": offset,
                    "scroll": scroll
                }
            });
        }
        StayPosition.prototype.run = function() {
            for (var i = 0,
            l = this.objs.length; i < l; i++) {
                this.obj = this.objs[i];
                this.end = (document.documentElement[this.obj.prop.scroll] || document.body[this.obj.prop.scroll]) + this.obj.prop.size;
                if (this.end != this.obj.dom[this.obj.prop.offset]) {
                    this.round = this.end - this.obj.dom[this.obj.prop.offset] > 0 ? Math.ceil: Math.floor;
                    this.obj.dom.style[this.obj.prop.name] = this.obj.dom[this.obj.prop.offset] + this.round((this.end - this.obj.dom[this.obj.prop.offset]) * this.speed) + "px";
                }
            }
        }
    }
    StayPosition.initialize = true;
}